Skip to content

fix(settings): keep the --app hint on the daemon route and type mode for photos only - #5026

Merged
thymikee merged 4 commits into
callstack:mainfrom
imranbarbhuiya:fix/settings-followups
Nov 23, 2026
Merged

thymikee merged 4 commits into
callstack:mainfrom
imranbarbhuiya:fix/settings-followups

Conversation

@imranbarbhuiya

@imranbarbhuiya imranbarbhuiya commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #5006 and #5019.

  • Daemon route keeps the --app guidance. parseSettingsArgs returned only the code and message, so a caller sending positionals straight to the daemon lost setting_permission_app_positional and the --app hint. It now normalizes the AppError like other daemon handlers, matching the CLI route.
  • SettingsUpdateOptions takes mode only with photos. The targets that take a mode are read from the catalog forms; every other target types mode?: never, so { permission: 'camera', mode: 'limited' } fails to compile instead of at runtime. A caller that forwards a wide PermissionTarget together with a mode must now narrow it to 'photos' before passing the mode.
  • Help. The settings help says iOS simulator wifi and airplane change only the status bar.
  • Test. The wifi/airplane warning test now checks the setting name and "status bar".

Before / after

parseSettingsArgs with ['permission', 'deny', 'notifications', 'com.example.app']:

   "code": "INVALID_ARGS",
-  "message": "settings permission notifications takes no mode."
+  "message": "settings permission notifications takes no mode.",
+  "hint": "Pass the app with --app com.example.app.",
+  "details": { "reason": "setting_permission_app_positional", "dispatched": "no", "permission": "notifications", "app": "com.example.app" }

tsc on const o: SettingsUpdateOptions = { setting: 'permission', state: 'grant', permission: 'camera', mode: 'limited' }:

base: exit 0
head: probe.ts(2,116): error TS2322: Type 'string' is not assignable to type 'undefined'.

Validation

  • Focused unit-core runs: the four touched settings test files (87 tests) and the command-doc guards (77 tests) passed. generate:command-docs reports commands.md is current.
  • Mutants (each fails a test): dropping the daemon-route details, naming wifi in the airplane warning, removing "status bar", letting non-photos targets take a mode, emptying the moded target set.
  • Base aecafaf30, head e15ede08b. pnpm check:affected --run --head e15ede08b: format, lint, typecheck, layering, fallow, build, package, integration-node, and vitest-related passed.

Start Proof
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

View guided diff

…aemon route

Positionals sent straight to the daemon, such as permission deny notifications com.example.app, came back with only the code and message, so the caller lost setting_permission_app_positional and the --app hint that the CLI route shows. Normalize the AppError the way other daemon handlers do.
SettingsUpdateOptions accepted mode for every permission target, so { permission: 'camera', mode: 'limited' } compiled and failed at runtime. Read the moded targets from the catalog forms and refuse mode for the rest.
@thymikee

Copy link
Copy Markdown
Member

Thanks for the fix. The PR is ready at e15ede0: the --app hint stays on the daemon route and mode is accepted for photos only, and no problems were found. Not blocking: the iOS-simulator wifi/airplane help sentence and the app-settings test tweak are a separate change from this issue, and settings parse refusals other than the permission case now also carry the INVALID_ARGS hint and retriable flag, so one sentence in the PR body would cover that; both can be taken or left. CI shows no failures: the two non-passing Body rules checks were cancelled rather than failed, probably by PR body edits, and the other 15 checks pass, including typecheck. The Body rules checks need a re-run to go green before merge. Not verified here: tests were not run locally, and no live device run was done, which this change does not need because the refusal happens before any device dispatch. There are no conflicts.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 23, 2026
@thymikee
thymikee merged commit 015d090 into callstack:main Nov 23, 2026
15 of 17 checks passed
@imranbarbhuiya
imranbarbhuiya deleted the fix/settings-followups branch November 23, 2026 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants